install -m0644 include/public/COPYING $(prefix)/usr/include/xen
dist: $(TARGET)
- $(MAKE) prefix=`pwd`/../install dist=yes install
+ $(MAKE) prefix=`pwd`/../dist/install dist=yes install
clean:
$(MAKE) -C figlet clean
HOSTCC = gcc
HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
+test-gcc-flag = $(shell gcc -v --help 2>&1 | grep -q " $(1) " && echo $(1))
+
include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
ifneq ($(debug),y)
CFLAGS += -DTRACE_BUFFER
endif
+CFLAGS := $(strip $(CFLAGS))
+
%.o: %.c $(HDRS) Makefile
$(CC) $(CFLAGS) -c $< -o $@
x86_32/usercopy.o: CFLAGS += -O1
endif
-
# Prevent floating-point variables from creeping into Xen.
CFLAGS += -msoft-float
+# Disable PIE/SSP if GCC supports them. They can break us.
+CFLAGS += $(call test-gcc-flag,-nopie)
+CFLAGS += $(call test-gcc-flag,-fno-stack-protector)
+CFLAGS += $(call test-gcc-flag,-fno-stack-protector-all)
+
ifeq ($(TARGET_SUBARCH),x86_32)
CFLAGS += -m32 -march=i686
LDFLAGS := --oformat elf32-i386